<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>码匠社区</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />


    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="css/community.css">
    <!--markdown-->
    <link rel="stylesheet" href="/css/editormd.preview.min.css" />
    <script src="js/jquery-3.4.1.min.js"></script>
    <script  src="js/bootstrap.min.js" type="application/javascript"></script>
    <!--markdown-->
    <script src="/js/editormd.min.js"></script>
    <script src="/js/lib/marked.min.js"></script>
    <script src="/js/lib/prettify.min.js"></script>
    <script type="application/javascript">
        window.onload = function () {
            var closable = window.localStorage.getItem("closable");
            if(closable === "true"){
                window.close();
                window.localStorage.removeItem("closable");
            }
        }
    </script>
</head>
<body>
<div class="wrapper">
    <div class="content">
        <div th:insert="~{navigation :: nav} "></div>
        <div class="container-fluid main">
            <div class="row">
                <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
                    <h2><span class="glyphicon glyphicon-list" aria-hidden="true"></span> 发现</h2>
                    <hr>
                    <div class="media" th:each="quesitonDto:${paginationDTO.data}">
                        <div class="media-left">
                            <a href="#">
                                <img class="media-object img-circle" th:src="${quesitonDto.user.avatarUrl}">
                            </a>
                        </div>
                        <div class="media-body">
                            <h4 class="media-heading">
                                <a th:href="@{'/question/'+${quesitonDto.id}}" th:text="${quesitonDto.title}"></a>
                            </h4>


                            <span id="question_view" >
                        <textarea th:text="${#strings.abbreviate(quesitonDto.description,300)}" th:title="${quesitonDto.description}" style="display: none"></textarea>
                    </span>
                            <script type="text/javascript">
                                $(function() {
                                    editormd.markdownToHTML("question_view", {});
                                });
                            </script>


                            <!--<span th:text="${quesitonDto.description}"></span><br>-->
                            <!--<span th:text="${#strings.abbreviate(quesitonDto.description,300)}" th:title="${quesitonDto.description}"></span>-->
                            <br>
                            <br>
                            <span class="text-desc">
                        <span th:text="${quesitonDto.commentCount}"></span>回复 ·
                        <span th:text="${quesitonDto.viewCount}"></span>浏览 ·
                        <span th:text="${#dates.format(quesitonDto.gmtCreate,'yyyy-MM-dd')}"></span>
                    </span>
                        </div>
                    </div>
                    <!-- 分页 -->
                    <nav aria-label="Page navigation">
                        <ul class="pagination">
                            <li th:if="${paginationDTO.showFirstPage}">
                                <a th:href="@{/(page=1,search=${search})}" aria-label="Previous">
                                    <span aria-hidden="true">&laquo;</span>
                                </a>
                            </li>
                            <li th:if="${paginationDTO.showPrevious}">
                                <a th:href="@{/(page=${paginationDTO.page - 1},search=${search})}" aria-label="Previous">
                                    <span aria-hidden="true">&lt;</span>
                                </a>
                            </li>
                            <li th:each="page:${paginationDTO.pages}" th:class="${paginationDTO.page == page} ?'active':''">
                                <a th:href="@{/(page=${page},search=${search})}" th:text="${page}" ></a>
                            </li>
                            <li th:if="${paginationDTO.showNext}">
                                <a th:href="@{/(page=${paginationDTO.page + 1},search=${search})}" aria-label="Next">
                                    <span aria-hidden="true">&gt;</span>
                                </a>
                            </li>
                            <li th:if="${paginationDTO.showEndPage}">
                                <a th:href="@{/(page=${paginationDTO.totalPages},search=${search})}" aria-label="Next">
                                    <span aria-hidden="true">&raquo;</span>
                                </a>
                            </li>
                        </ul>
                    </nav>
                </div>
                <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <h3>关注我们</h3>
                        <img src="/images/andios-blue.jpg" class="img-thumbnail question-andios-img">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div content="footer1">
        <div th:insert="~{footer :: foot} "></div>
    </div>

</div>

</body>
</html>